<?php 
namespace app\index\controller;
use think\Controller;

/*
 * 签到
 */
class Sign extends Controller
{
	public function index()
	{
		$id = $_POST['id'];
		$data = db('signin')->where('uid',$id)->find();
		if ($data == null) {
			db('signin')->insert(['uid'=>$id,'status'=>1,'create_time'=>time(),'integral'=>10]);

			$user = db('information')->where('userid',$id)->find()['jifen'];
			db('information')->where('userid',$id)->update(['jifen'=>($user+10)]);
			return 1;
		}
	}
}